package com.yjz.springlearn.SpringAnnotation;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

/**
 * @Desc
 * @Author: jinzhong.yuan
 * @Date: 2019/2/18 18:23
 */
@Configuration
public class MyConfigure {

  @Conditional(WindowsCondition.class)
  @Bean(name = "bill")
  public User getUser1() {
    return new User("比尔盖茨", "27");
  }

  @Bean(name = "linus")
  @Conditional(LinuxCondition.class)
  public User getUser2() {
    return new User("linus", "27");
  }

}
